import request from '@/common/request.js';

//获取app最新版本号
export function getAPPVersion(params) {
	let baseApiUrl = uni.getStorageSync("baseApiUrl");
	let base_url = 'http://' + baseApiUrl + '/';
	
	return request.httpRequest({
		url: base_url + 'api/AppIndex/getAppVersionInfo',
		method: 'post',
		loading: true,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}

//登录
export function postLogin(params) {	
	let baseApiUrl = uni.getStorageSync("baseApiUrl");
	let base_url = 'http://' + baseApiUrl + '/';
	
	return request.httpRequest({
		url: base_url + 'api/AppIndexNew/login',
		method: 'post',
		loading: true,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}

//修改密码
export function editMyPassword(params) {
	let baseApiUrl = uni.getStorageSync("baseApiUrl");
	let base_url = 'http://' + baseApiUrl + '/';
	
	return request.httpRequest({
		url: base_url + 'api/AppIndex/changePassword',
		method: 'post',
		loading: true,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}

//获取座席信息
export function getSeatInfo(params) {
	let baseApiUrl = uni.getStorageSync("baseApiUrl");
	let base_url = 'http://' + baseApiUrl + '/';
	
	return request.httpRequest({
		url: base_url + 'api/AppIndex/getSeatInfo',
		method: 'post',
		loading: true,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}

//修改座席信息
export function updateSeatInfo(params) {
	let baseApiUrl = uni.getStorageSync("baseApiUrl");
	let base_url = 'http://' + baseApiUrl + '/';
	
	return request.httpRequest({
		url: base_url + 'api/AppIndex/updateSeatInfo',
		method: 'post',
		loading: true,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}

//修改座席呼叫方式
export function updateSeatCallType(params) {
	let baseApiUrl = uni.getStorageSync("baseApiUrl");
	let base_url = 'http://' + baseApiUrl + '/';
	
	return request.httpRequest({
		url: base_url + 'api/Index/updateSeatCallType',
		method: 'post',
		loading: true,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}

//获取回拨号码信息
export function getCbPhoneNumberInfo(params) {
	let baseApiUrl = uni.getStorageSync("baseApiUrl");
	let base_url = 'http://' + baseApiUrl + '/';
	
	return request.httpRequest({
		url: base_url + 'api/AppIndex/getCbPhoneNumberInfo',
		method: 'post',
		loading: true,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}